form(ng-submit='newProfile.$valid && $close(profile)' name='newProfile')
  .modal-header
    button.close(type='button' ng-click='$dismiss()')
      span(aria-hidden='true') ×
      span.sr-only Close
    h4.modal-title {{'options_modalHeader_newProfile' | tr}}
  .modal-body
    .form-group(ng-class='{"has-error": !newProfile.profileNewName.$valid}')
      label(for='profile-new-name') {{'options_newProfileName' | tr}}
      input#profile-new-name.form-control(type='text' name='profileNewName' required ng-model='profile.name'
        ui-validate='validateProfileName' autofocus)
      .help-block(ng-show='newProfile.profileNewName.$error.required') {{'options_profileNameEmpty' | tr}}
      .help-block(ng-show='newProfile.profileNewName.$error.reserved') {{'options_profileNameReserved' | tr}}
      .help-block(ng-show='!newProfile.profileNewName.$error.reserved && newProfile.profileNewName.$error.conflict')
        | {{'options_profileNameConflict' | tr}}
      .help-block(ng-show='newProfile.profileNewName.$valid && profile.name && isProfileNameHidden(profile.name)')
        .text-info
          span.glyphicon.glyphicon-info-sign
          = ' '
          | {{'options_profileNameHidden' | tr}}
    label {{'options_profileType' | tr}}
    .radio
      label
        input(type='radio' name='profile-new-type' value='FixedProfile' ng-model='profile.profileType' ng-init='profile.profileType = "FixedProfile"')
        span.profile-type
          span.glyphicon(ng-class='profileIcons["FixedProfile"]')
          = ' '
          span {{'options_profileTypeFixedProfile' | tr}}
        .help-block {{'options_profileDescFixedProfile' | tr}}
    .radio
      label
        input(type='radio', name='profile-new-type', value='SwitchProfile' ng-model='profile.profileType')
        span.profile-type
          span.glyphicon(ng-class='profileIcons["SwitchProfile"]')
          = ' '
          span {{'options_profileTypeSwitchProfile' | tr}}
        .help-block {{'options_profileDescSwitchProfile' | tr}}
    .radio
      label
        input(type='radio', name='profile-new-type', value='PacProfile' ng-model='profile.profileType' ng-disabled='pacProfilesUnsupported')
        span.profile-type
          span.glyphicon(ng-class='profileIcons["PacProfile"]')
          = ' '
          span {{'options_profileTypePacProfile' | tr}}
        .help-block {{'options_profileDescPacProfile' | tr}}
        .help-block(ng-show='!pacProfilesUnsupported') {{'options_profileDescMorePacProfile' | tr}}
        .has-error(ng-show='pacProfilesUnsupported')
          .help-block
            span.glyphicon.glyphicon-warning-sign
            = ' '
            | {{'options_pac_profile_unsupported_moz' | tr}}
    .radio
      label
        input(type='radio', name='profile-new-type', value='VirtualProfile' ng-model='profile.profileType')
        span.profile-type
          span.glyphicon.virtual-profile-icon(ng-class='profileIcons["VirtualProfile"]')
          = ' '
          span {{'options_profileTypeVirtualProfile' | tr}}
        .help-block {{'options_profileDescVirtualProfile' | tr}}
  .modal-footer
    button.btn.btn-default(type='button' ng-click='$dismiss()') {{'dialog_cancel' | tr}}
    button.btn.btn-primary(type='submit' ng-disabled='!newProfile.$valid') {{'options_createProfile' | tr}}
